import api from '../api.js';

const getListAsync = async (data) => {
    return await api.postWithToken({
        command: 'I_Customer_GetCustomers',
        data
    });
};

const addAsync = async (data) => {
    return await api.postWithToken({
        command: 'I_Customer_New',
        data
    });
};

const editAsync = async (data) => {
    return await api.postWithToken({
        command: 'I_Customer_Modify',
        data
    });
};

const deleteAsync = async (id) => {
    return await api.postWithToken({
        command: 'I_Customer_Delete',
        data: {
            id: id
        }
    });
};

export default {
    getListAsync,
    addAsync,
    editAsync,
    deleteAsync,
}